<template>
  <form>
    <label>Username:</label>
    <input type="password" id="password" name="password" v-model="loginForm.password">
    <br>
    <br>
    <input type="submit" value="Submit" @click="validate">
  </form>
</template>

<script>
export default {
  data(){
    return{
      loginForm:{
        username:'',
        password:''
      },
    }
  },
  methods:{
    validate(){
      if (this.loginForm.username == 'zs' && this.loginForm.password=="123"){
        alert('登陆成功');

      }else {
        alert("Invalid username or password. Please try again.")

      }

    }

  },
}
</script>

<style scoped>

</style>